/*=========================================================================

Program:   VMTK
Module:    $RCSfile: vtkTriangleWrapper.h,v $
Language:  C++
Date:      $Date: 2010/10/22 03:51:59 $
Version:   $Revision: 1.1.1.1 $

  Copyright (c) Luca Antiga, David Steinman. All rights reserved.
  See LICENCE file for details.

  Portions of this code are covered under the VTK copyright.
  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm 
  for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
  // .NAME vtkTriangleWrapper - Trianglation.
  // .SECTION Description
  // ...

#ifndef __vtkTriangleWrapper_h
#define __vtkTriangleWrapper_h

#include "vtkPolydataAlgorithm.h"
#include "vtkPoints.h"

class vtkAbstractTransform;

class VTK_EXPORT vtkTriangleWrapper : public vtkPolyDataAlgorithm
{
  public: 
  static vtkTriangleWrapper *New();
  vtkTypeRevisionMacro(vtkTriangleWrapper,vtkPolyDataAlgorithm);
  void PrintSelf(ostream& os, vtkIndent indent); 

  vtkSetMacro(poly,int);
  vtkGetMacro(poly,int);
  vtkBooleanMacro(poly,int);
  
  vtkSetMacro(refine,int);
  vtkGetMacro(refine,int);
  vtkBooleanMacro(refine,int);

  vtkSetMacro(quality,int);
  vtkGetMacro(quality,int);
  vtkBooleanMacro(quality,int);
  
  
  vtkSetMacro(vararea,int);
  vtkGetMacro(vararea,int);
  vtkBooleanMacro(vararea,int);

  vtkSetMacro(fixedarea,int);
  vtkGetMacro(fixedarea,int);
  vtkBooleanMacro(fixedarea,int);

  vtkSetMacro(usertest,int);
  vtkGetMacro(usertest,int);
  vtkBooleanMacro(usertest,int);

  vtkSetMacro(regionattrib,int);
  vtkGetMacro(regionattrib,int);
  vtkBooleanMacro(regionattrib,int);

  vtkSetMacro(convex,int);
  vtkGetMacro(convex,int);
  vtkBooleanMacro(convex,int);

  vtkSetMacro(weighted,int);
  vtkGetMacro(weighted,int);
  vtkBooleanMacro(weighted,int);

  vtkSetMacro(jettison,int);
  vtkGetMacro(jettison,int);
  vtkBooleanMacro(jettison,int);

  vtkSetMacro(edgesout,int);
  vtkGetMacro(edgesout,int);
  vtkBooleanMacro(edgesout,int);

  vtkSetMacro(voronoi,int);
  vtkGetMacro(voronoi,int);
  vtkBooleanMacro(voronoi,int);

  vtkSetMacro(noholes,int);
  vtkGetMacro(noholes,int);
  vtkBooleanMacro(noholes,int);

  vtkSetMacro(noexact,int);
  vtkGetMacro(noexact,int);
  vtkBooleanMacro(noexact,int);

  vtkSetMacro(conformdel,int);
  vtkGetMacro(conformdel,int);
  vtkBooleanMacro(conformdel,int);

  vtkSetMacro(incremental,int);
  vtkGetMacro(incremental,int);
  vtkBooleanMacro(incremental,int);

  vtkSetMacro(sweepline,int);
  vtkGetMacro(sweepline,int);
  vtkBooleanMacro(sweepline,int);

  vtkSetMacro(dwyer,int);
  vtkGetMacro(dwyer,int);
  vtkBooleanMacro(dwyer,int);

  vtkSetMacro(splitseg,int);
  vtkGetMacro(splitseg,int);
  vtkBooleanMacro(splitseg,int);

  vtkSetMacro(docheck,int);
  vtkGetMacro(docheck,int);
  vtkBooleanMacro(docheck,int);

  vtkSetMacro(quiet,int);
  vtkGetMacro(quiet,int);
  vtkBooleanMacro(quiet,int);

  vtkSetMacro(verbose,int);
  vtkGetMacro(verbose,int);
  vtkBooleanMacro(verbose,int);

  vtkSetMacro(usesegments,int);
  vtkGetMacro(usesegments,int);
  vtkBooleanMacro(usesegments,int);

  vtkSetMacro(order,int);
  vtkGetMacro(order,int);
  vtkBooleanMacro(order,int);

  vtkSetMacro(nobisect,int);
  vtkGetMacro(nobisect,int);
  vtkBooleanMacro(nobisect,int);


  vtkSetMacro(minangle,double);
  vtkGetMacro(minangle,double);

  vtkSetMacro(goodangle,double);
  vtkGetMacro(goodangle,double);

  vtkSetMacro(offconstant,double);
  vtkGetMacro(offconstant,double);

  vtkSetMacro(maxarea,double);
  vtkGetMacro(maxarea,double);

  vtkSetMacro(raylinelen,double);
  vtkGetMacro(raylinelen,double);

//   virtual void SetTransform(vtkAbstractTransform*);
//   vtkGetObjectMacro(Transform, vtkAbstractTransform);


//////////////////////////////////////////////////////////////////////////


//   vtkSetStringMacro(lineIdsArrayName);
//   vtkGetStringMacro(lineIdsArrayName);
// 
//   vtkSetStringMacro(TetrahedronVolumeArrayName);
//   vtkGetStringMacro(TetrahedronVolumeArrayName);
// 
//   vtkSetStringMacro(SizingFunctionArrayName);
//   vtkGetStringMacro(SizingFunctionArrayName);
// 
//   vtkSetStringMacro(TetrahedronAttributeArrayName);
//   vtkGetStringMacro(TetrahedronAttributeArrayName);
// 
//   vtkSetMacro(OutputSurfaceElements,int);
//   vtkGetMacro(OutputSurfaceElements,int);
//   vtkBooleanMacro(OutputSurfaceElements,int);
// 
//   vtkSetMacro(OutputVolumeElements,int);
//   vtkGetMacro(OutputVolumeElements,int);
//   vtkBooleanMacro(OutputVolumeElements,int);
// 
//   vtkSetMacro(UseSizingFunction,int);
//   vtkGetMacro(UseSizingFunction,int);
//   vtkBooleanMacro(UseSizingFunction,int);

  void SetRegionPoints(vtkPoints* pts);
  void SetRegionList(double* RegList, int regCount);

  void SetHolePoints(double *holes, int holeCount);

  protected:
  vtkTriangleWrapper();
  ~vtkTriangleWrapper();

  vtkAbstractTransform * ComputeBestFittingPlane(vtkPointSet *input);

  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);

  int poly, refine, quality, vararea, fixedarea, usertest;
  int regionattrib, convex, weighted, jettison;
  int firstnumber;
  int edgesout, voronoi, neighbors, geomview;
  //int nobound, nopolywritten, nonodewritten, noelewritten, noiterationnum;
  int noholes, noexact, conformdel;
  int incremental, sweepline, dwyer;
  int splitseg;
  int docheck;
  int quiet, verbose;
  int usesegments;
  int order;
  int nobisect;
  int steiner;
  double minangle, goodangle, offconstant;
  double maxarea;
  double raylinelen;

  vtkAbstractTransform *Transform;

//   int Poly;
//   int Refine;
//   int Quality;
//   int VarArea;
//   int FixedArea;
//   double MaxArea;
// 
//   int RemoveSliver;
//   double MaxDihedral;
//   int RegionAttrib;
//   int RegionNum; // add [1/14/2009 JYB]
//   double Epsilon;
//   int NoMerge;
//   int DetectInter;
//   int CheckClosure;
//   int Order;
//   int DoCheck;
//   int Verbose;
//   int UseSizingFunction;
//   double MinRatio;

  char* lineIdsArrayName;
  char* TriangleArrayName;
//   char* SizingFunctionArrayName;
//   char* TetrahedronAttributeArrayName; // add [1/17/2009 JYB]
// 
//   int OutputSurfaceElements;
//   int OutputVolumeElements;


  vtkPoints* RegionPoints;
  double* RegionList;

  double *holesList;
  int holeCount;

  private:
  vtkTriangleWrapper(const vtkTriangleWrapper&);  // Not implemented.
  void operator=(const vtkTriangleWrapper&);  // Not implemented.
};

#endif
